package dynamic_state;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Classname static_proxy.ProxyCenter
 * @Description TODO
 * @Date 2023/9/1 17:20
 * @Created by wpc
 */
public class ProxyCenter implements InvocationHandler {
    StartSkill star;
    public ProxyCenter(StartSkill star){
        this.star = star;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("对象被代理前");
        Object result = method.invoke(star,args);
        System.out.println("对象被代理后");
        return result;
    }
}
